Don't allow to set up GL waveforms if GL is not available - #15762
Don't allow to set up GL waveforms if GL is not available #15762daschuer wants to merge 16 commits into
Conversation
|
Thanks for looking into this! This PR overlaps with the changes of #15421 |
|
Yes that seems to be reasonable. |
|
Is this maybe also fixing #15858 ?? |
…but not available.
Hehe.. |
|
Do we need this in 2.6? |
|
The 2.5 branch is not affected. |
|
Yes, I meant is this one considered a blocker or can it fall behind to 2.6.1? |
|
It fixes a crash at least. |
|
@daschuer there are conflicts now. Merge 2.6 or rebase @acolombier ? |
|
The fix a6e3b02 looks good, but I can hardly give formal LGTM for a PR where the meat is my cleanup/consolidation commits from #15421 @acolombier wanna take a look? |
acolombier
left a comment
There was a problem hiding this comment.
Code is looking good, thanks both for the good cleanup! Ran a few manual tests and everything still seem to function as expected.
Let merge this in 2.6 and as this improve the GL situation with waveform,
|
@daschuer pre-commit is failing, do you want to take a look? |
|
This is again ready for merge. |
|
@m0dB merge? Maybe someone else wants to do it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Prevents crashes when OpenGL is unavailable by sanitizing backend selection and centralizing waveform option/backend handling inside WaveformWidgetFactory (issue #14561).
Changes:
- Add factory helpers for setting/render backend acceleration and for reading/writing waveform renderer options.
- Sanitize configured backend based on GL/GLES/shader availability.
- Move several preference-dialog config writes/reads into
WaveformWidgetFactory(e.g., beat grid alpha, waveform options).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/waveform/waveformwidgetfactory.h | Exposes new APIs for acceleration and waveform option management. |
| src/waveform/waveformwidgetfactory.cpp | Adds backend sanitization and centralizes config persistence for acceleration/options/beat grid alpha. |
| src/preferences/dialog/dlgprefwaveform.h | Refactors private helpers to rely on factory-managed backend/option state. |
| src/preferences/dialog/dlgprefwaveform.cpp | Uses factory APIs instead of directly manipulating config for backend/options; adjusts UI update logic accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WaveformWidgetBackend backend = m_config->getValue( | ||
| kHardwareAccelerationKey, | ||
| preferredBackend()); | ||
| } | ||
| switch (backend) { | ||
| case WaveformWidgetBackend::None: | ||
| break; | ||
| case WaveformWidgetBackend::GL: | ||
| if (!m_openGlAvailable) { | ||
| backend = WaveformWidgetBackend::None; | ||
| } | ||
| break; | ||
| case WaveformWidgetBackend::GLSL: | ||
| if (!m_openGlAvailable || !m_openGLShaderAvailable) { | ||
| backend = WaveformWidgetBackend::None; | ||
| } | ||
| break; | ||
| #ifdef MIXXX_USE_QOPENGL | ||
| case WaveformWidgetBackend::AllShader: | ||
| if (!m_openGlAvailable && !m_openGlesAvailable) { | ||
| backend = WaveformWidgetBackend::None; | ||
| } | ||
| break; | ||
| #endif | ||
| } | ||
| return backend; | ||
| }; |
| WaveformWidgetBackend WaveformWidgetFactory::setAcceleration(bool enabled) { | ||
| WaveformWidgetBackend backend = WaveformWidgetBackend::None; | ||
| if (enabled) { | ||
| backend = | ||
| #ifdef MIXXX_USE_QOPENGL | ||
| WaveformWidgetBackend::AllShader | ||
| #else | ||
| WaveformWidgetBackend::GL | ||
| #endif | ||
| ; | ||
| } | ||
| m_config->setValue(kHardwareAccelerationKey, backend); | ||
| return backend; | ||
| } |
| allshader::WaveformRendererSignalBase::Options WaveformWidgetFactory::getWaveformOptions() { | ||
| auto options = m_config->getValue( | ||
| kWaveformOptionsKey, | ||
| allshader::WaveformRendererSignalBase::Option::None); | ||
| return options; | ||
| } |
| for (const auto& holder : std::as_const(m_waveformWidgetHolders)) { | ||
| holder.m_waveformWidget->setDisplayBeatGridAlpha(m_beatGridAlpha); | ||
| } | ||
| m_config->setValue(ConfigKey(kWaveformGroup, QStringLiteral("beatGridAlpha")), alpha); |
|
Done |
|
clazy ant macOS now complain about congif enums 🤷♂️ |
a0083a9 to
4eb59e7
Compare
|
Now all runners stumle over that unfortunatly. |
|
conflicts resolved. |
|
LGTM but the configobject changes are a bit above my paygrade. |
This fixes a crasher when no GL is available, but GL functions are used anyway. #14561